package com.iot.device.service.impl;

import java.util.List;
import java.util.Map;

import com.iot.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.iot.device.mapper.PressureSensorClientMapper;
import com.iot.device.domain.PressureSensorClient;
import com.iot.device.service.IPressureSensorClientService;

/**
 * 压力传感器设备Service业务层处理
 * 
 * @author iot
 * @date 2023-06-13
 */
@Service
public class PressureSensorClientServiceImpl implements IPressureSensorClientService 
{
    @Autowired
    private PressureSensorClientMapper pressureSensorClientMapper;

    /**
     * 查询压力传感器设备
     * 
     * @param id 压力传感器设备主键
     * @return 压力传感器设备
     */
    @Override
    public PressureSensorClient selectPressureSensorClientById(Long id)
    {
        return pressureSensorClientMapper.selectPressureSensorClientById(id);
    }

    /**
     * 查询压力传感器设备列表
     * 
     * @param pressureSensorClient 压力传感器设备
     * @return 压力传感器设备
     */
    @Override
    public List<PressureSensorClient> selectPressureSensorClientList(PressureSensorClient pressureSensorClient)
    {
        return pressureSensorClientMapper.selectPressureSensorClientList(pressureSensorClient);
    }

    /**
     * 新增压力传感器设备
     * 
     * @param pressureSensorClient 压力传感器设备
     * @return 结果
     */
    @Override
    public int insertPressureSensorClient(PressureSensorClient pressureSensorClient)
    {
        pressureSensorClient.setCreateTime(DateUtils.getNowDate());
        return pressureSensorClientMapper.insertPressureSensorClient(pressureSensorClient);
    }

    /**
     * 修改压力传感器设备
     * 
     * @param pressureSensorClient 压力传感器设备
     * @return 结果
     */
    @Override
    public int updatePressureSensorClient(PressureSensorClient pressureSensorClient)
    {
        pressureSensorClient.setUpdateTime(DateUtils.getNowDate());
        return pressureSensorClientMapper.updatePressureSensorClient(pressureSensorClient);
    }

    /**
     * 批量删除压力传感器设备
     * 
     * @param ids 需要删除的压力传感器设备主键
     * @return 结果
     */
    @Override
    public int deletePressureSensorClientByIds(Long[] ids)
    {
        return pressureSensorClientMapper.deletePressureSensorClientByIds(ids);
    }

    /**
     * 删除压力传感器设备信息
     * 
     * @param id 压力传感器设备主键
     * @return 结果
     */
    @Override
    public int deletePressureSensorClientById(Long id)
    {
        return pressureSensorClientMapper.deletePressureSensorClientById(id);
    }

    @Override
    public synchronized PressureSensorClient selectPressureSensorClientBySn(String sn) {
        return pressureSensorClientMapper.selectPressureSensorClientBySn(sn);
    }

    @Override
    public Map<String, Long> selectPressureSensorClientStatistics(Long userId) {
        return pressureSensorClientMapper.selectPressureSensorClientStatistics(userId);
    }

    @Override
    public Map<String, Long> countPressureSensorClientsByUserId(Long userId) {
        return null;
    }
}
